package com.kingschan.jeasytag.core.validation.properties.impl;

import java.lang.reflect.Field;

import com.kingschan.jeasytag.core.validation.properties.PropertiesValidation;
import com.kingschan.jeasytag.exception.PropertiesValidationException;
/**
 * BooleanFieldValidationImpl
 * @author kingschan
 *date:2013-07-11
 */
public class BooleanFieldValidationImpl implements PropertiesValidation{

	@Override
	public void validation(Field f, Object value)throws PropertiesValidationException {
		if (!value.toString().matches("[true]{4}|[false]{5}")) {
			throw new PropertiesValidationException(String.format("the Properties %s  must be true or false !", f.getName()));
		}
	}

}
